package java111_2;

import java.util.Scanner;

public class Day34 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        int res = 0, count = 1;
        for(int i = 0; i < str.length()-1; i++){
            if(str.charAt(i) != '-'){
                res += Integer.parseInt(str.charAt(i) + "") * count++;
            }
            res %= 11;
        }
        String ret;
        if(res == 10){
            ret = str.substring(0, str.length() - 1) + "X";
        } else {
            ret = str.substring(0, str.length() - 1) + res;
        }
        System.out.println(ret.equals(str) ? "Right" : ret);
    }
}
